package com.blog.cloud.api.feign;

import com.blog.cloud.api.dto.UserInfoDto;
import com.blog.cloud.api.dto.UserRegisterDto;
import com.blog.cloud.api.entity.User;
import com.blog.cloud.core.utils.R;
import jakarta.validation.Valid;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "blog-cloud-service")
public interface UserFeignService {

    @PostMapping("/user/findUserByUsername")
    R<UserInfoDto> findUserByUsername(@RequestBody String username);

    @PostMapping("/user/findUserByMobile")
    R<UserInfoDto> findUserByMobile(@RequestBody String mobile);

    @PostMapping("/user/findUserByFlag")
    R<User> findUserByFlag(@RequestBody @Valid UserRegisterDto registerDto);

    @PostMapping("/user/saveUser")
    R<Boolean> saveUser(@RequestBody @Valid UserRegisterDto registerDto);
}
